1. Field of the Invention
The present invention relates generally to a method and apparatus for monitoring occurrences of events in a computing system and more specifically to a shift register and a counter for counting such occurrences and for providing an occurrence history.
2. Description of the Related Art
It is often important to monitor the performance of a hardware device and/or a software application, e.g., a processor executing a software application. Such monitoring may include the detection of the occurrence of certain events, e.g., misses in a cache, overflows in buffers, functional unit utilization, and so on. Monitoring these events provides insights into the performance of the hardware device and/or software application. For example, a hardware designer may use such records to perform trouble shooting functions or to get ideas about improving the design, while a software designer may use the same to identify inefficiencies in programs and hence to improve its performance.
It is often impractical to count all occurrences of an event during the course of running an application because the resulting count may exceed the capability of reasonably sized counters. For example, the number of clock cycles, and hence the potential number of events, for an application that runs for 6 minutes at 3 Ghz is more than 1 trillion, a number that takes 40 bits to be represented.
Although one can certainly count the occurrences of the monitored event over a period of time, it does not provide information as to when the event occurred within the monitored period. In other words, a simple counting of the monitored event is insufficient to satisfy the monitoring needs for some applications.
Thus, there is a need for a method and apparatus for monitoring occurrences of events and for providing both a reasonable count as well as a reasonable indication of the recent history of the occurrences.